package vcp.common;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Observable;

import client.Message;
import control.SimpleClient;

public class AbstractModel extends Observable implements PropertyChangeListener  {
	protected SimpleClient client = null;
	protected Message msg = null;

	@Override
	public void propertyChange(PropertyChangeEvent event) {
		if (event.getPropertyName().equals("MessageUpdate")) {			    
		    msg = client.getReturnMsg();
		    setChanged();
			notifyObservers(msg);				
        }
		//System.out.println(msg);
		client.clearPropertyChangeListener();
		//msg = null;
	}
}
